package com.example.demo.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.example.demo.pojo.EmployeeDo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * @Description: EmpListener
 * </p>
 * @Author yangjiwang
 * @Date 2023/2/27
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class EmpListener extends AnalysisEventListener<EmployeeDo> {

    private List<EmployeeDo> employeeList = new ArrayList<>();

    @Override
    public void invoke(EmployeeDo employeeDo, AnalysisContext analysisContext) {
        employeeList.add(employeeDo);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
